<script setup>
	import {
		ref,
		computed,
		reactive,
		onMounted
	} from "vue";

	const props = defineProps({});
	onMounted(() => {});
	let platform = uni.getStorageSync("platform");
	const list = ref([])
	const goback = () => {
		uni.navigateBack();
	};
	const removeUser = () => {
		uni.removeStorageSync("USER_TOKEN_INFOS");
		setTimeout(() => {
			uni.navigateTo({
				url: "/pages/login/login",
			});
		}, 500);
	};
	const showPage = (index) => {
		switch (index) {
			case 0:
				uni.navigateTo({
					url: "/pages/user/components/worldStudyItem?id=" + (index + 1),
				});
				break;
			case 1:
				uni.navigateTo({
					url: "/pages/user/components/studyTool?id=" + (index + 1),
				});
				break;
			case 2:
				uni.navigateTo({
					url: "/pages/user/components/studyTool?id=" + (index + 1),
				});
				break;
			default:
				console.log('Unknown index:', index);
		}
	};
</script>

<template>
	<view class="wrap" :style="{
      height: platform.gaodu + 'rpx',
    }">
		<view class="header-wrap uni-row" :style="{
        paddingTop: platform.dingbu + 'rpx',
        height: platform.dingbu + 96 + 'rpx',
      }">
			<image class="left" src="/static/img/goback-black.png" @click="goback" mode="widthFix" />
			<view class="title"> 单词 </view>
			<image style="opacity: 0" class="left" src="/static/img/goback-black.png" @click="goback" mode="widthFix" />
		</view>
		<scroll-view scroll-y="true" :style="{ height: platform.gaodu - platform.dingbu - 96 + 'rpx' }">
			<view class="body ">
				<view @click="showPage(index)" class="item uni-row" v-for="(item,index) in 3" :key="index">
					<image src="/static/img/user/world/icon1.png" class="icon"></image>
					<view class="text">
						单词学习记录{{index+1}}
					</view>
				</view>
			</view>
			<view class="footer"> </view>
		</scroll-view>
	</view>
</template>

<style scoped lang="less">
	.wrap {
		background: url("/static/img/wolrd/bg.png");
		background-size: 100% 100%;

		.header-wrap {
			justify-content: space-between;
			padding-left: 24rpx;
			padding-right: 24rpx;

			.left {
				width: 48rpx;
			}

			.title {
				font-weight: 500;
				font-size: 32rpx;
				color: #333333;
			}
		}

		.body {
			padding: 0 28rpx;

			.item {
				height: 100rpx;
				background: #FFFFFF;
				border-radius: 16rpx;
				margin-bottom: 16rpx;
				padding: 0 28rpx;

				.icon {
					width: 48rpx;
					height: 48rpx;
					margin-right: 20rpx;
				}

				.text {
					font-weight: 500;
					font-size: 28rpx;
					color: #333333;
				}
			}
		}
	}
</style>